package com.qd.common.sys.domain.event;

import com.qd.common.sys.domain.entity.log.OperatorLogDTO;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.util.Optional;

/**
 * 〈一句话功能简述〉<br>
 *
 * @author sjk
 * @since 1.0.0
 */
@Data
@Accessors(chain = true)
@EqualsAndHashCode
public class OperatorDTO {
    private Long startTime;
    private Long endTime;
    private String requestParam;
    private Object responseParam;
    private OperatorLogDTO operatorLog;

    public void freeData() {
        this.startTime = null;
        this.endTime = null;
        this.requestParam = null;
        this.responseParam = null;
        Optional.ofNullable(operatorLog).ifPresent(OperatorLogDTO::freeData);
    }
}